import { Injectable, OnModuleInit } from '@nestjs/common';
import { UsersService } from './users/users.service';

@Injectable()
export class AppService implements OnModuleInit {
  constructor(private readonly usersService: UsersService) {}

  async onModuleInit() {
    // 应用启动时创建默认管理员用户
    await this.usersService.createDefaultAdmin();
  }

  getHello(): string {
    return '工厂计时器后端服务运行正常！访问 /auth 进行用户认证';
  }
}